<%--
  管路员界面显示订单信息
  User: gyy
  Date: 2021-04-08
  Time: 11:34
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<html lang="en">

<head>
    <c:import url="commons.jsp"></c:import>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <meta name="author" content="">
    <title>SB Admin</title>
    <!-- Bootstrap core CSS-->
    <link href="${pd}/statics/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <!-- Custom fonts for this template-->
    <link href="${pd}/statics/vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <!-- Page level plugin CSS-->
    <link href="${pd}/statics/vendor/datatables/dataTables.bootstrap4.css" rel="stylesheet">
    <!-- Custom styles for this template-->
    <link href="${pd}/statics/css/sb-admin.css" rel="stylesheet">
    <script src="${pd}/statics/js/jquery.js"></script>
    <script>

        function deleteAlert(id){
            var htm="";
            var tbodylist = $("#tbodylist");
            $.ajax({
                url:"todelect.action",
                type:"get",
                dataType:'json',
                data:{"ids":id},
                success:function (data){

                    for(var i =0;i<data.length;i++){
                        htm+="<tr>"
                            +"<td><input name='ids'type='checkbox' value='"+data[i].oId+"'/></td>"
                            +"<td>"+data[i].userName+"</td>"
                            +"<td>"+data[i].cName+"</td>"
                            +"<td>"+data[i].clName+"</td>"
                            +"<td>"+data[i].coName+"</td>"
                            +"<td>"+data[i].cDate+"</td>"
                            +"<td>"+data[i].cMoney+"</td>"
                            +"<td>"+data[i].coTime+"</td>"
                            +"<td>"+data[i].oStatus+"</td>"
                            +"<td><input type='button' value='删除' onclick='deleteAlert("+data[i].oId+")' /></td>"
                            +"</tr>"
                    }
                    tbodylist.html(htm);
                }
            })
        }
    </script>
    <script>
        //全选
        function selectUserAll(obj) {
            console.log(obj);
            if (obj.checked == true) {
                //打开全选，下面的所有选择框都祖选择
                $("[name='ids']").prop("checked",true);
            } else {
                //关闭全选
                $("[name='ids']").prop("checked",false);
            }
        }
    </script>
    <script>e

    function deleteordr(id){
        console.log(id);
    }



    </script>

</head>

<body class="fixed-nav sticky-footer bg-dark" id="page-top">
<%--<h1 style="text-align: center" id="gyy">--%>
<%--    <input type="text" id="fyy" value="like"></h1>--%>
<c:import url="adminNav.jsp"></c:import>
<div class="content-wrapper">
    <div class="container-fluid">
        <!-- 用户信息-->
        <div class="card mb-3">
            <div class="card-header">
                <i class="fa fa-table"></i> 订单信息</div>

            <div class="card-body">
                <div class="table-responsive">
                    <form action="orderDelect.action" method="post" >
                        <table class="table table-bordered" id="dataTable" width="100%" cellspacing="0">
                            <thead>
                            <tr>
                                <th> <input type="checkbox" onclick="selectUserAll(this)"></th>
                                <th>用户名</th>
                                <th>课程名</th>
                                <th>俱乐部名称</th>
                                <th>教练名称</th>
                                <th>开课时间</th>
                                <th>课时费</th>
                                <th>课程时长</th>
                                <th>预约状态</th>

                            </tr>
                            </thead>

                            <tbody id="tbodylist">
                            <c:forEach var="courseOrder" items="${ordersList}">

                                <tr id="changelist">
                                    <td><input name="ids" type="checkbox" value="${courseOrder.cId}" /></td>
                                    <td>${courseOrder.userName}</td>
                                    <td>${courseOrder.cName}</td>
                                    <td>${courseOrder.clName}</td>
                                    <td>${courseOrder.coName}</td>
                                    <td>${courseOrder.cDate}</td>
                                    <td>${courseOrder.cMoney}</td>
                                    <td>${courseOrder.coTime}</td>
                                    <td>${courseOrder.oStatus}</td>
                                    <td><input type="button" value="删除" onclick="deleteAlert(${courseOrder.cId})"></td>

                                </tr>
                            </c:forEach>
                            </tbody>

                        </table>

                        <div style="text-align: center">
                            <input class="btn btn-yellow btn-w-md" value="删除" type="submit" onclick="deleteAlert()"   id="btn"/>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>


<!-- Bootstrap core JavaScript-->
<%--    <script src="statics/vendor/jquery/jquery.min.js"></script>--%>
<script src="${pd}/statics/vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
<!-- Core plugin JavaScript-->
<script src="${pd}/statics/vendor/jquery-easing/jquery.easing.min.js"></script>
<!-- Page level plugin JavaScript-->
<%--    <script src="statics/vendor/datatables/jquery.dataTables.js"></script>--%>
<script src="${pd}/statics/vendor/datatables/dataTables.bootstrap4.js"></script>
<!-- Custom scripts for all pages-->
<script src="${pd}/statics/js/sb-admin.min.js"></script>
<!-- Custom scripts for this page-->
<script src="${pd}/statics/js/sb-admin-datatables.min.js"></script>
</div>
</body>

</html>
